package com.example.homework1.Controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
public class RandomController {

    @GetMapping("/random")
    public String getRandomNumber() {
        Random random = new Random();
        int randomNumber = random.nextInt(1000) + 1; // 生成1-1000之间的随机整数
        return "<div style=\"text-align:center;\">" + randomNumber + "</div>";
    }
}